package cn.itcast.day04;

import java.util.Random;

public class Demo2 {
    public static void main(String[] args) {
        show(new Inter() {
            @Override
            public int getNumber() {
                Random rd = new Random();
                int num = rd.nextInt(100);
               return num ;
            }
        });
        System.out.println("----------");
        show(()->{
            Random rd = new Random();
            int num = rd.nextInt(100);
            return num;});
    }
    public static void show (Inter i ){
        int number = i.getNumber();
        System.out.println(number);

    }
}
interface  Inter{
    int getNumber();
}
